﻿using System;
using System.Data;

namespace Azalea.ORMap
{
    public interface IDbFactory
    {
        string ParameterPrefix { get; }
        string SingleWildcard { get; }
        string MultiWildcard { get; }
        IDbConnection NewConnection();
        IDbCommand NewCommand();
        IDataAdapter NewDataAdapter(IDbCommand cmd);
        IDataParameter NewParameter();

        string GetParameterName(string field);

        bool IsReservedKeyword(string word);
        string Quoting(string word);

        Type GetTypeFromDbType(DbType dbType);
        DbType GetDbTypeFromType(Type type);

        string GetSqlStatementToGetSchema();
        string GetFunctionNameToGetAutoIncrementValue();
    }
}